<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>吃果果 | 上班族的网上鲜切水果店</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
</script>
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<script src="js/jquery.min.js"></script>	
</head>

<body>
<!----start-header----------->
<div class="header_bg">
	<div class="wrap">
		<div class="header">
			<!--------start-logo------>
			<div class="logo">
				<a href="www.chiguoguo.com.cn"><img src="images/logo.png" alt="图片加载失败" /></a>
			</div>	
			<!--------end-logo--------->
			<div class="clear"> </div>
		</div>
	</div>
</div>
<!------end-header------------>

<!--start amount------>
<div class="wrap" id="left_amount">
	<div class='logo' id='activity_name'>
		<img src='images/activity.png' alt="图片加载失败"/>
	</div>
	<h1><img src='images/left_amount.png' alt="图片加载失败"/></h1>
    <h2>
		<?php 
			//$con = @mysql_connect(SAE_MYSQL_HOST_M.':'.SAE_MYSQL_PORT,SAE_MYSQL_USER,SAE_MYSQL_PASS);
			$con = @mysql_connect("localhost".':'."3306","root","mysql");
			if (!$con)
			{
				die('亲，由于网络太忙，现在无法领取，请您稍后重试。');
			}

			//mysql_select_db(SAE_MYSQL_DB, $con);
			mysql_select_db("chiguoguo", $con);
			
			$sql="SELECT amount FROM `gift`";
			$result = mysql_query($sql);
			
			$row = mysql_fetch_array($result);
			
			$left_amount=$row['amount'];
			
			echo $left_amount;

			mysql_close($con);
		?>
	</h2>			
</div>
<!---end amount----->

<!-----start-button-------->
<div class="logo" id='collect_button'>
	<?php
		if($left_amount > 0)
		{
			echo "<a href='order_gift.html'><img src='images/collect_button.png' alt='图片加载失败' /></a>";
		}else{
			echo "<p>亲，今天的活动套餐已经派送完毕！</p>";
			echo "<p>请您明日再来，谢谢您的合作！</p>";
		}
	?>
	<div class="clear"></div>
</div>
<!-----end-button-------->
</body>
</html>